package NIOCommunication;

import java.io.IOException;
import java.nio.channels.SocketChannel;

public class NIOProcessorCloseContextCommand extends NIOProcessorCommand
{
	private NIOContext mContext;
        private boolean mTimedOut;
	
	public NIOProcessorCloseContextCommand(NIOContext context)
	{
		mContext = context;
                mTimedOut = false;
	}
        
	public NIOProcessorCloseContextCommand(NIOContext context, boolean timedOut)
	{
		mContext = context;
                mTimedOut = timedOut;
	}
	
	public void Execute(NIOProcessor processor)
	{
		mContext.Close();
                if(mTimedOut)
                {
                    mContext.OnTimeout();
                }
	}
}
